package com.copc.common.exception;

/**
 * 封装common的异常
 *
 * @author yuanbin
 * @Date 2017/12/28 下午10:32
 */
public class CommonException extends RuntimeException {

    private String code;

    private String message;

    public CommonException(ServiceExceptionEnum serviceExceptionEnum) {
        this.code = serviceExceptionEnum.getCode();
        this.message = serviceExceptionEnum.getMessage();
    }

    public CommonException(String code, String message) {
		this.code = code;
		this.message = message;
	}
    
    public CommonException(String message) {
		this.code = "200";
		this.message = message;
	}
    
    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    @Override
    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }
}
